package com.sun.weekend.base;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.sun.weekend.beans.BundleBean;
import com.sun.weekend.beans.UserBean;
import com.sun.weekend.util.EventBusUtil;
import com.sun.weekend.util.Go2Util;
import com.sun.weekend.util.LogUtils;

import cn.bmob.v3.BmobUser;

/**
 * @author sunleilei
 */

public abstract class BaseActivity extends AppCompatActivity{

    protected Bundle bundle;
    protected UserBean userBean;
    protected Context mContext;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        bundle = getIntent().getExtras();
        mContext = getApplicationContext();
        if (bundle == null) {
            bundle = new Bundle();
        }

    }

    @Override
    protected void onStart() {
        super.onStart();
        userBean = BmobUser.getCurrentUser(UserBean.class);
    }

    protected void onEventMainThread(EventBusUtil.EventBusBean busBean) {
        LogUtils.logi("onEventMainThread");
    }

    public void login() {
        BundleBean bean = new BundleBean();
        bean.setSign("RegisterAndLogin");
        Go2Util.startDetailActivity(this,bean);
    }


}
